package com.ruoyi.shop.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.ShopRefundApplyMapper;
import com.ruoyi.shop.domain.ShopRefundApply;
import com.ruoyi.shop.service.IShopRefundApplyService;
import com.ruoyi.common.core.text.Convert;

/**
 * 退款申请Service业务层处理
 * 
 * @author Alan Zhang
 * @date 2021-10-02
 */
@Service
public class ShopRefundApplyServiceImpl implements IShopRefundApplyService 
{
    @Autowired
    private ShopRefundApplyMapper shopRefundApplyMapper;

    /**
     * 查询退款申请
     * 
     * @param id 退款申请主键
     * @return 退款申请
     */
    @Override
    public ShopRefundApply selectShopRefundApplyById(Long id)
    {
        return shopRefundApplyMapper.selectShopRefundApplyById(id);
    }

    /**
     * 查询退款申请列表
     * 
     * @param shopRefundApply 退款申请
     * @return 退款申请
     */
    @Override
    public List<ShopRefundApply> selectShopRefundApplyList(ShopRefundApply shopRefundApply)
    {
        return shopRefundApplyMapper.selectShopRefundApplyList(shopRefundApply);
    }

    /**
     * 新增退款申请
     * 
     * @param shopRefundApply 退款申请
     * @return 结果
     */
    @Override
    public int insertShopRefundApply(ShopRefundApply shopRefundApply)
    {
        shopRefundApply.setCreateTime(DateUtils.getNowDate());
        return shopRefundApplyMapper.insertShopRefundApply(shopRefundApply);
    }

    /**
     * 修改退款申请
     * 
     * @param shopRefundApply 退款申请
     * @return 结果
     */
    @Override
    public int updateShopRefundApply(ShopRefundApply shopRefundApply)
    {
        return shopRefundApplyMapper.updateShopRefundApply(shopRefundApply);
    }

    /**
     * 批量删除退款申请
     * 
     * @param ids 需要删除的退款申请主键
     * @return 结果
     */
    @Override
    public int deleteShopRefundApplyByIds(String ids)
    {
        return shopRefundApplyMapper.deleteShopRefundApplyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除退款申请信息
     * 
     * @param id 退款申请主键
     * @return 结果
     */
    @Override
    public int deleteShopRefundApplyById(Long id)
    {
        return shopRefundApplyMapper.deleteShopRefundApplyById(id);
    }
}
